package com.zzxx.mapper;

import com.zzxx.entity.ActivityContent;
import com.zzxx.entity.ActivityContentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ActivityContentMapper extends ActivityContentMapperEx{
    @SelectProvider(type=ActivityContentSqlProvider.class, method="countByExample")
    long countByExample(ActivityContentExample example);

    @DeleteProvider(type=ActivityContentSqlProvider.class, method="deleteByExample")
    int deleteByExample(ActivityContentExample example);

    @Delete({
        "delete from activitycontent",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into activitycontent (id, activityId, ",
        "userId, msg, likeNum, ",
        "createTime)",
        "values (#{id,jdbcType=VARCHAR}, #{activityid,jdbcType=VARCHAR}, ",
        "#{userid,jdbcType=VARCHAR}, #{msg,jdbcType=VARCHAR}, #{likenum,jdbcType=INTEGER}, ",
        "#{createtime,jdbcType=TIMESTAMP})"
    })
    int insert(ActivityContent row);

    @InsertProvider(type=ActivityContentSqlProvider.class, method="insertSelective")
    int insertSelective(ActivityContent row);

    @SelectProvider(type=ActivityContentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="activityId", property="activityid", jdbcType=JdbcType.VARCHAR),
        @Result(column="userId", property="userid", jdbcType=JdbcType.VARCHAR),
        @Result(column="msg", property="msg", jdbcType=JdbcType.VARCHAR),
        @Result(column="likeNum", property="likenum", jdbcType=JdbcType.INTEGER),
        @Result(column="createTime", property="createtime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<ActivityContent> selectByExample(ActivityContentExample example);

    @Select({
        "select",
        "id, activityId, userId, msg, likeNum, createTime",
        "from activitycontent",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="activityId", property="activityid", jdbcType=JdbcType.VARCHAR),
        @Result(column="userId", property="userid", jdbcType=JdbcType.VARCHAR),
        @Result(column="msg", property="msg", jdbcType=JdbcType.VARCHAR),
        @Result(column="likeNum", property="likenum", jdbcType=JdbcType.INTEGER),
        @Result(column="createTime", property="createtime", jdbcType=JdbcType.TIMESTAMP)
    })
    ActivityContent selectByPrimaryKey(String id);

    @UpdateProvider(type=ActivityContentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") ActivityContent row, @Param("example") ActivityContentExample example);

    @UpdateProvider(type=ActivityContentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") ActivityContent row, @Param("example") ActivityContentExample example);

    @UpdateProvider(type=ActivityContentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ActivityContent row);

    @Update({
        "update activitycontent",
        "set activityId = #{activityid,jdbcType=VARCHAR},",
          "userId = #{userid,jdbcType=VARCHAR},",
          "msg = #{msg,jdbcType=VARCHAR},",
          "likeNum = #{likenum,jdbcType=INTEGER},",
          "createTime = #{createtime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ActivityContent row);
}